﻿using System.Windows;
using System.Windows.Controls;
using SmartSpace.UI.Silverlight;
using SmartSpace.UI.Silverlight.Theme;
using System.Windows.Media;
using System;

namespace SmartSpace.UI.Silverlight.Themes.Fashtion
{
    public partial class WorkAreaPanel : SlView, IWorkAreaPanel
    {
        public WorkAreaPanel()
        {
            InitializeComponent();
            m_viewContainer.SwitchEffect = new HorizontalSwitchEffect();
        }

        public void Init()
        {

            if ((Application.Current as SlApp).Params.DebugMode)
            {
                //m_hyperlinkButtonDebug.Visibility = System.Windows.Visibility.Visible;
            }
        }

        #region IWorkAreaPanel Members

        public void Switch(SlView view)
        {
            m_viewContainer.SwitchView(view);
        }

        public event Action<SlView, int> SwitchExEvent;

        public void SwitchEx(SlView view, object arguments)
        {
            if (SwitchExEvent != null)
            {
                SwitchExEvent(view, (int)arguments);
            }
        }

        public SlView GetContentView()
        {
            return this;
        }

        #endregion

        private void m_hyperlinkButtonDebug_Click(object sender, RoutedEventArgs e)
        {
            SlView view = m_viewContainer.CurrentView;
            if (view != null)
            {
                MessageBox.Show(view.GetType().FullName);
            }
        }

        public SlViewContainer GetSlViewContainer()
        {
            return m_viewContainer;
        }
    }
}
